import { ElInput, ElButton } from 'element-plus'
import { ref } from 'vue'
/**
 * 组件列表
 */
export const componentList = [
  {
    name: 'button',
    preview: <ElButton>我是预览按钮</ElButton>,
    render: <ElButton>我是预览按钮</ElButton>
  },
  {
    name: 'input',
    preview: <ElInput placeholder="我是预览输入框"></ElInput>,
    render: <ElInput placeholder="我是渲染输入框"></ElInput>
  },
  {
    name: 'text',
    preview: '我是预览文本',
    render: '我是渲染文本'
  }
]
/**
 * 组件映射
 */
export const componentMap = new Map<string, any>([
  ['text', { render: '我是渲染文本' }],
  ['input', { render: <ElInput placeholder="我是渲染输入框"></ElInput> }],
  ['button', { render: <ElButton>我是预览按钮</ElButton> }]
])

/**
 * 全局响应式导入导出数据变量
 */
export const jsonData = ref<JsonData>({ container: {}, blocks: [] })
interface JsonData {
  container: {
    [key: string]: any
  }
  blocks: Array<any>
}
